﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Satire.Common;

namespace Satire.Lexer
{

    public class DfaBuilder
    {
        public DfaBuilder(int capacity, int maxChar)
        {
            _sets = new Dictionary<DynamicArray<int>,int>(capacity);
            _actionsmax = new List<DFA.ActionOperand>(capacity);
            _cols = maxChar;
        }
        public DFA GenerateDfa(Nfa nfa)
        {
            _sets.Clear();
            _actions.Clear();
            _tableBuilder = new TableBuilder<int>(_cols);
            





            return null;
        }
        private Dictionary<DynamicArray<int>, int> _sets;
        private List<DFA.ActionOperand> _actions;
        private TableBuilder<int> _tableBuilder;
        private int _cols;
    }


    public class DFA
    {
        internal DFA(Table<int> table, ActionOperand[] actions, int[] entryPoints)
        {
            _table = table;
            _actions = actions;
            _entryPoints = entryPoints;
        }
        internal struct ActionOperand 
        {
            StateAction action;
            int operand;
        }
        #region private
        private int[] _entryPoints;
        private Table<int> _table;
        private ActionOperand[] _actions;
        #endregion
    }
}
